package com.spring.mybatisplus.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.spring.mybatisplus.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
//继承BaseMapper使用其提供的CRUD功能
//也可以自定义功能，如下面的selectByNameOrAge
@Mapper
public interface UserMapper extends BaseMapper<User> {
    @Select("select * from user where name=#{name} or age=#{age}")
    List<User> selectByNameOrAge(String name, Integer age);
}
